package com.zhz.salarys.config.mybtatis.generator;


import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
import com.zhz.common.utils.IdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author zhouhengzhe
 * @date 2023/3/30
 */
@Component
public class CustomerIdGenerator implements IdentifierGenerator {
    @Autowired
    private IdWorker idWorker;
    /**
     * 生成Id
     *
     * @param entity 实体
     * @return id
     */
    @Override
    public Number nextId(Object entity) {
        return idWorker.nextId();
    }
}
